/* 
 * File:   PostingFile.h
 * Author: eduardo
 *
 * Created on 5 de noviembre de 2012, 21:02
 */

#ifndef POSTINGFILE_H
#define	POSTINGFILE_H

#include <map>
#include <vector>
#include <string>
#include "DocOccurrence.h"
using namespace std;

class PostingFile {
public:
    PostingFile();
    ~PostingFile();

    void insertElement(int key, const vector<DocOccurrence>& value);
    void insertElement(int key, const DocOccurrence& value);

    const vector<DocOccurrence>& getValue(int key);
    
    void clear();

    map<int, vector<DocOccurrence> >::iterator getBegin() {
        return _postEntry.begin();
    }

    map<int, vector<DocOccurrence> >::iterator getEnd() {
        return _postEntry.end();
    }

private:
    map<int, vector<DocOccurrence> > _postEntry;

    inline bool belongTo(int key);
};

#endif	/* POSTINGFILE_H */

